package com.digital.welcome.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.digital.welcome.entity.Pay;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Repository;

/**
 * @author 韩
 */
@Mapper
@Repository
public interface PayMapper extends BaseMapper<Pay> {

    Pay selectPayByUserName(String userName);

    Pay selectPayInformation(String username);

    @Select("select paytype from pay where user_name=#{username} and state=1")
    String getType(String username);

    int updateState(String gmtPayment,String outTradeNo, String buyerId,String buyerPayAmount,Integer state,String tradeNo);
    @Select("select user_name from pay where trade_no = #{tradeNo} and state=1")
    String selectUserName(String tradeNo);
}
